<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<c-rt:set scope="request" var="theForm" value="theForm"/>
<c-rt:if test="${! empty param.theForm }">
	<c-rt:set scope="request" var="theForm" value="${param.theForm}"/>
</c-rt:if>
<c-rt:set var="commonQuestionTypes" value="${pu:queryByHql('from CommonQuestionType where parent is null', null, null)}"/>

	<script language="javascript">
	$(document).ready( function() {

		$('#cqtMain${param.zonePostfix}').change(function(){
			if ("${param.setCompensation}" == "Y") setCompensation();
			var form;
			doAR('<%=application.getContextPath() %>/cs/page.do?iamlazy=subTypeList&parentId='+document.${theForm}.class1.value+'&workFlowNodeId=${param.workFlowNodeId}&allowBackward=${param.allowBackward}&parentWorkOrderNodeId=${param.parentWorkOrderNodeId}&zonePostfix=${param.zonePostfix}&theForm=${theForm}', 'class2Zone${param.zonePostfix}', form, function(){
				doAR('<%=application.getContextPath()%>/cs/page.do?iamlazy=level3List&parentId=', 'commonQuestionTypeZone${param.zonePostfix}');
				$('#mustInquireZone${param.zonePostfix}').html("");
				$('#forwardOrderZone${param.zonePostfix}').html("");
				
			});
			
		});
		
		setCompensation();
	});
	
	function setCompensation() {
		var class1Text = $('select#cqtMain${param.zonePostfix} option:selected').text();
		try {
			if (class1Text == "问题投诉") {
				$("#compensationArea").show();
			} else {
				$("#compensationArea").hide();
			}
		} catch (e) {}
	}
	</script>

<select name="class1" id="cqtMain${param.zonePostfix}">
	<option value="">请选择</option>
	<c-rt:forEach items="${commonQuestionTypes }" var="cqt">
		<option value="${cqt.id }" <c-rt:if test="${cqt.id==param.class1 }">selected="selected"</c-rt:if>>${cqt.name }</option>
	</c-rt:forEach>
</select>


